<?php
	include("../manejadores/manejadorBD.php");
	$db = new manejadorBD();
	
	$username = $_POST['username'];
	$password = md5($_POST['password']);
	
	if($email = ($db->autenticar($username,$password))){
		session_start();
		$_SESSION['email'] = $email;
		$_SESSION['timeout'] = time();
		$_SESSION['inactive'] = 600;
		echo "<script type='text/javascript'>window.location = 'aprobacion.php'; </script>";
	}else{
		echo "<script type='text/javascript'>window.location = 'index.php?login=0'; </script>";
	}
?>